import http from '@/utils/request'

export const userApi = {
    // 用户登录
    login(params) {
        return http.post('UserController/login', {
            userName: params.userName,
            password: params.password
        })
    },

    // 用户注册
    register(params) {
        return http.post('UserController/register', params)
    },

    // 检查用户名是否存在
    checkUserId(userId) {
        return http.post('UserController/getUserById', {
            userId
        })
    },

    // 获取用户信息
    getUserInfo(params) {
        return http.post('UserController/getUserInfo', {
            userName: params.userName
        })
    }
}

export default userApi
